home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / NETCALL.422 < prev    next >
Text File  |  1993-03-20  |  8KB  |  259 lines

  1. Put Net-callins in your LASTON.TXT and USER.LOG files!
  2. The Flying Chicken [SysOp] #1 @12456
  3. 3Tuesday, March 16, 1993  1 8:06 pm
  4. ==============================================================================
  5.                   NET.MOD
  6.  
  7. List NET CALLS after the last few callers like VBBS does!
  8. Revised for 4.22 by,
  9. Altair 1 @14259 LINK 1 @4259 NET
  10. Mon Febuary 15, 10:00 am 1993
  11. Dificulty Easy....
  12. Version: 422 and most others as long as
  13.      they are running NET 32. With the right modification
  14.      this mod will work with NET 31 also.
  15.  
  16.    Let me stress that the idea for this mod is originally not mine.
  17.    I just added things here and there to make it work a little nicer.
  18.  
  19. ==============================================================================
  20.  
  21. OkAY Ever noticed how when you log on to a BBS running the VBBS software, and
  22. there has been a net connection recently, it displays the network's name
  23. after the "Last Few Callers" section?  Well, I kinda like that.  I thought
  24. "Hey, why can't we do that with WWIV?"  The most obvious problem is that
  25. the writes to NET.LOG are made by the network software, NOT by WWIV.
  26. Therefore, one would have to modify the network software to get it to do
  27. it then.  Well, instead of that, what this mod does is a tad more difficult.
  28. When the BBS notices it's a network connection <usernum==-2> it runs the
  29. network program.  AFTER that, it does a tiny bit of processing.  <Cleaning
  30. up from the network, re-initializing the modem, etc>  Well, I figured, "Why
  31. not read the NET.LOG file, find out what the last connection was, and then
  32. write it to the LASTON1.TXT and USER1.LOG files?"  That's what I did.
  33.  
  34.  
  35. Anyway, as it's written this mod will ONLY work for NET32, as it uses certain
  36. info the way NET 32 writes it to the log.
  37. With minor modification it can work on 4.21 and lower.
  38.  
  39. > I added a few things to this mode like, color and the name of the last
  40. >   network connected to along with it's phone number.
  41. >   All credit for this mode must still go to the
  42. >   original Author Galen Pathwarden #1 @17303
  43.  
  44.  
  45. FILES AFFECTED:  LILO.C
  46.          NETSUP.C
  47.          BBS.C
  48.          SYSOPF.C
  49.          FCNS.H
  50.  
  51. KEY: +++ add line
  52.      === Look for line
  53.      --- Delete Line
  54.      ??? Modifiy Line
  55.  
  56.  
  57. STEP ONE: BACK UP YOUR SOURCE!  I am not responsible for ANY damage caused
  58. to your source, data files, or computer as a result of this mod.  It has been
  59. tested on my system and has caused no problems.
  60.  
  61.  
  62. STEP TWO: Load LILO.C
  63. Scan down for VOID GETUSER.  A little ways down, it will have the stuff
  64. with NETWORK.EXE, REMOTE.EXE, etc.  A tiny bit below that, add this section
  65. of code:
  66.  
  67. ===              get_status();
  68. ===              if (l!=status.qscanptr) {
  69. ===                for (i=0; i<num_subs; i++) {
  70. ===                  sub_dates[i]=0L;
  71. ===                }
  72. ===              }
  73. +++              if (usernum==-2)
  74. +++                add_net_to_log();
  75. ===              hangup=1;
  76. ===              dtr(0);
  77. ===              global_xx=0;
  78.  
  79.  
  80.  while still in LILO.C  in void logon(); search down for this section of code
  81.  and add the additions. this will also make your last few callers print in colo
  82. r.
  83.  (Delete your laston.txt and user.log in the gfiles directory)
  84.  Because of the new format for these files.......
  85.  
  86. ===    pl(s1);
  87. ===  }
  88. ===  while (pos<len);
  89. ===  }
  90. +++ printfile("LASTON1.TXT");
  91. === nl();
  92. === if ((actsl!=255) || (incom)) {
  93. ===   sl1(0,"");
  94. ===   sl1(0,s);
  95. ===   sl1(1,"");
  96. ???   sprintf(s,"4[3%ld4]1: 2%-34s  1%s  5%s  7%s - %d\r\n",0
  97. ===          status.callernum1,
  98. ===          nam(&thisuser,usernum),
  99. ???          times(),
  100. ???          date(),
  101. ===          curspeed,
  102. ===          thisuser.ontoday);
  103.  
  104.  
  105. STEP THREE: Save LILO.C, and load NETSUP.C
  106. Add this entire void at the bottom.
  107.  
  108.  
  109. void add_net_to_log(void)
  110. {
  111.    int nn,sn,i,i1,f;
  112.    char s[81],s1[81],s2[81],*ss;
  113.    FILE *fil;
  114.    long len,pos;
  115.    net_system_list_rec *csne;
  116.  
  117.    sprintf(s,"%sNET.LOG",syscfg.gfilesdir);
  118.    if ((fil=fopen(s,"rt"))==NULL)
  119.      return;
  120.    fgets(s1,22,fil);    /* change to 24 for NET 31 and below */
  121.    fgets(s1,6,fil);
  122.    if (s1[strlen(s1)]==',')
  123.      s1[strlen(s1)]=0;
  124.    sn=atoi(s1);
  125.    fclose(fil);
  126.    for (nn=0; nn<net_num_max; nn++) {
  127.      set_net_num(nn);
  128.      if (!net_sysnum)
  129.        continue;
  130.      if (!net_networks[net_num].con)
  131.        read_call_out_list();
  132.      i=-1;
  133.      for (i1=0; i1<net_networks[net_num].num_con; i1++) {
  134.        if (net_networks[net_num].con[i1].sysnum == sn) {
  135.      i=i1;
  136.      break;
  137.        }
  138.      }
  139.      if (i==i1)
  140.        break;
  141.    }
  142.    if (i==-1)
  143.      return;
  144.    strcpy(s1,net_networks[net_num].name);
  145.    csne=next_system(sn);
  146.    sprintf(s,"5%-4s: 2@3%-6d1%-25s 2%s  7%s\r\n",0
  147.                    s1,   /* Net Name */
  148.                    sn,   /* Node Connected */
  149.                    csne->name,
  150.                    csne->phone,
  151.                    times());
  152.    pl(s);
  153.    sprintf(s2,"%sLASTON1.TXT",syscfg.gfilesdir);      /* Makes a file named LAS
  154. TON1.TXT in G-files directory */
  155.    ss=get_file(s2,&len);
  156.    sprintf(s1,"%sUSER1.LOG",syscfg.gfilesdir);        /* Makes a file named USE
  157. R1.LOG in G-files directory */
  158.    f=open(s1,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE);
  159.    lseek(f,0L,SEEK_END);
  160.    i=strlen(s);
  161.    write(f,(void *)s,i);
  162.    close(f);
  163.    f=open(s2,O_RDWR | O_BINARY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
  164.    pos=0;
  165.    copy_line(s1,ss,&pos,len);
  166.    for (i=1; i<4; i++) {
  167.      copy_line(s1,ss,&pos,len);
  168.      strcat(s1,"\r\n");
  169.      write(f,(void *)s1,strlen(s1));
  170.    }
  171.    write(f,(void *)s,strlen(s));
  172.    close(f);
  173. }
  174.  
  175.  
  176.  
  177. STEP FOUR: Save NETSUP.C, load FCNS.H
  178. add to end of NETSUP.C the void you just put in.
  179.  
  180.  
  181. /* File: netsup.c */
  182.  
  183. Add this line:
  184.  
  185. === void print_pending_list(void);
  186. +++ void add_net_to_log(void);
  187.  
  188.  
  189.  
  190. STEP FIVE: Save FCNS.H, COMPILE!
  191.  
  192. STEP SIX: Wait for a network call to come in, and check the laston1.txt and
  193. you'll see the network's name and the node listed, along with the Name of
  194. the board, the Phone number, and time!  WOW!
  195.  
  196. STEP SEVEN: open BBS.C This part is your option!!
  197.         you don't have to do this for the mod to work.
  198.         What this will do is make a /L option from the
  199.         main menu that will show the total Network connects
  200.         for the day.
  201.  
  202.  
  203. search for void mainmenu(void) and look for:
  204.  
  205. === if (strcmp(s,"/Z")==0) {
  206. ===   pl(get_string(26));
  207. ===   set_x_only(1, "POSTS.TXT", 0);
  208. ===   nscan(0);
  209. ===   set_x_only(0, NULL, 0);
  210. ===   add_arc("OFFLINE", "POSTS.TXT", 0);
  211. ===   download_temp_arc("OFFLINE", 0);
  212. ===  }
  213. +++ if (strcmp(s,"/L")==0) {
  214. +++   nl();
  215. +++   prt(1,"Network Connects");
  216. +++   printfile("USER1.LOG");
  217. +++ }
  218. === if (strcmp(s,"NET")==0)
  219. ===   print_net_listing(0);
  220.  
  221.   also remember to edit your menus so that the option will
  222.   be shown.............
  223.  
  224.  
  225.  
  226. STEP EIGHT: Load up SYSOPF.C and search for void beginday(void)
  227.         What this does is at midnight every day it will delete
  228.         the file USER1.LOG so you don't end up with just one
  229.         large file.
  230.         Then Look for this section of code and add what is below.
  231.  
  232.  
  233. ===  sprintf(s,"%s%s",syscfg.gfilesdir, ststus.log2);
  234. ===  unlink(s);
  235.  
  236. ===  sprintf(s,"%sUSER.LOG",syscfg.gfilesdir);
  237. ===  unlink(s)
  238.  
  239. +++  sprintf(s"%sUSER1.LOG",syscfg.gfilesdir);
  240. +++  unlink(s);
  241. ===  save_status();
  242. ===  sprintf(s,"%sZLOG.DAT",syscfg.datadir);
  243.  
  244.  
  245.   That's it for SYSOPF.C close it up and recompile the BBS.
  246.  
  247. STEP NINE: Send email if you have any problems with this.
  248.  
  249.  
  250. You can contact me at:
  251.     WWIVNET : 1@4259
  252.     WWIVLink: 1@14259
  253.  
  254. Or, call my BBS
  255.       Into The Night
  256.       (412)758-2456
  257.       300-2400 baud
  258.       24 Hours........
  259.